#include "fbgfx.bi"

const MI = 255/63

screenres 640,480,32

dim as any ptr MYIMG
dim as uinteger ptr PIX
dim as integer CNT

MYIMG = ImageCreate(512,512)

PIX = MYIMG+sizeof(fb.image)

CNT = 0
for R as short = 0 to 63
  for G as short = 0 to 63
    for B as short = 0 to 63
      PIX[CNT] = rgb(R*MI,G*MI,B*MI)
      CNT += 1
    next B
  next G
next R

bsave "Colors.bmp",MYIMG
put (0,0),MYIMG,pset
sleep